//
//  ZTActivityORGETPICCell.m
//  app001
//
//  Created by xionghao on 15/10/12.
//  Copyright © 2015年 xionghao. All rights reserved.
//

#import "ZTActivityORGETPICCell.h"
#import "ContentMode.h"
#import <UIImageView+WebCache.h>



@implementation ZTActivityORGETPICCell
+(instancetype)cellWithTableView:(UITableView *)tableView{
    static NSString *Id=@"ztacpic";
    
    ZTActivityORGETPICCell *cell=[tableView dequeueReusableCellWithIdentifier:Id];
    if (cell==nil) {
        [tableView registerNib:[UINib nibWithNibName:NSStringFromClass([self class]) bundle:nil] forCellReuseIdentifier:Id];
        cell=[tableView dequeueReusableCellWithIdentifier:Id];
    }
    return cell;
}
-(void)setMode:(ContentMode *)mode{
    _mode=mode;
    if (_mode.image==nil) {
        [self.pic sd_setImageWithURL:[NSURL URLWithString:[NSString getImageURLstr:_mode.url]] placeholderImage:[UIImage imageNamed:@"ztplacehoder"]];
    }else{
    self.pic.image=_mode.image;
    }
    self.info.text=_mode.info;
}

- (IBAction)buttonclick:(UIButton *)sender {
    if ([_delegate respondsToSelector:@selector(cell:clickWithIndex:)]) {
        [_delegate cell:self clickWithIndex:sender.tag];
    }
}
- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
